{% extends "base.html" %}

{% block content %}
<div id="admintable">
<a href="/editarticle">Add New Article</a>
<table>
    <tr class="table_header"><td >Date</td><td>Author</td><td>Type</td>
    <td>Title</td>
    <td>Categories</td><td>Published?</td><td>Main Feature?</td><td>View Preview</td></tr>
{% for article in articles %}
<tr class="table_row"><td>{{ article.date|date:"D, M d Y" }}</td><td>{{ article.authornickname }}</td><td>{{ article.type }}</td><td><a href="/editarticle?key={{ article.key }}">{{ article.title }}</a></td><td>
{% for category in article.categories %}
{{ category }}{% if not forloop.last %}, {% endif %}
{% endfor %}</td>
<td>{% if article.published %}Yes{% else %}No{% endif %}</td>
<td>{% if article.mainfeature %}Yes{% else %}No{% endif %}</td>
<td><a href="/article?key={{ article.key }}">Preview</a></td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}